package common;

import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

/**
 * Created by tangxinmao on 2017/5/28.
 */
public class TimerDemo {
    public static void main(String[] args) {
        Timer timer=new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
            }
        },2000);
        timer.scheduleAtFixedRate(new TimerTask() {
            @Override
            public void run() {

            }
        },new Date(),2000);
    }
}
